package tx.bjdacp.model;

import javax.persistence.*;

import org.hibernate.annotations.GenericGenerator;

import javax.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import java.util.*;

import javacommon.base.*;
import javacommon.util.*;

import cn.org.rapid_framework.util.*;
import cn.org.rapid_framework.web.util.*;
import cn.org.rapid_framework.page.*;
import cn.org.rapid_framework.page.impl.*;

import tx.bjdacp.model.*;
import tx.bjdacp.dao.*;
import tx.bjdacp.service.*;
import tx.bjdacp.vo.query.*;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;


@Entity
@Table(name = "bjdacp_data_dict")
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
public class DataDict extends BaseEntity implements java.io.Serializable{
	private static final long serialVersionUID = 5454155825314635342L;

	//alias
	public static final String TABLE_ALIAS = "DataDict";
	public static final String ALIAS_DD_ID = "ddId";
	public static final String ALIAS_DD_NAME = "ddName";
	public static final String ALIAS_DD_CODE = "ddCode";
	public static final String ALIAS_DD_VALUE = "ddValue";
	public static final String ALIAS_DD_TYPE = "ddType";

	//date formats


	//可以直接使用: @Length(max=50,message="用户名长度不能大于50")显示错误消息
	//columns START
    /**
     * ddId       db_column: dd_ID
     */

	private java.lang.Integer ddId;
    /**
     * ddName       db_column: dd_name
     */
	@Length(max=200)
	private java.lang.String ddName;
    /**
     * ddCode       db_column: dd_code
     */
	@Length(max=200)
	private java.lang.String ddCode;
    /**
     * ddValue       db_column: dd_value
     */
	@Length(max=2000)
	private java.lang.String ddValue;
    /**
     * ddType       db_column: dd_type
     */
	@Length(max=200)
	private java.lang.String ddType;
	//columns END


	public DataDict(){
	}

	public DataDict(
		java.lang.Integer ddId
	){
		this.ddId = ddId;
	}



	public void setDdId(java.lang.Integer value) {
		this.ddId = value;
	}

	@Id	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "dd_ID", unique = true, nullable = false, insertable = true, updatable = true, length = 10)
	public java.lang.Integer getDdId() {
		return this.ddId;
	}

	@Column(name = "dd_name", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getDdName() {
		return this.ddName;
	}

	public void setDdName(java.lang.String value) {
		this.ddName = value;
	}

	@Column(name = "dd_code", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getDdCode() {
		return this.ddCode;
	}

	public void setDdCode(java.lang.String value) {
		this.ddCode = value;
	}

	@Column(name = "dd_value", unique = false, nullable = true, insertable = true, updatable = true, length = 2000)
	public java.lang.String getDdValue() {
		return this.ddValue;
	}

	public void setDdValue(java.lang.String value) {
		this.ddValue = value;
	}

	@Column(name = "dd_type", unique = false, nullable = true, insertable = true, updatable = true, length = 200)
	public java.lang.String getDdType() {
		return this.ddType;
	}

	public void setDdType(java.lang.String value) {
		this.ddType = value;
	}


	public String toString() {
		return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
			.append("DdId",getDdId())
			.append("DdName",getDdName())
			.append("DdCode",getDdCode())
			.append("DdValue",getDdValue())
			.append("DdType",getDdType())
			.toString();
	}

	public int hashCode() {
		return new HashCodeBuilder()
			.append(getDdId())
			.toHashCode();
	}

	public boolean equals(Object obj) {
		if(obj instanceof DataDict == false) return false;
		if(this == obj) return true;
		DataDict other = (DataDict)obj;
		return new EqualsBuilder()
			.append(getDdId(),other.getDdId())
			.isEquals();
	}
}

